/**
 *
 */
package com.angel.architecture.services;

import com.angel.architecture.dtos.LoginInfoDTO;
import com.angel.architecture.exceptions.BusinessException;
import com.angel.architecture.persistence.beans.User;
import com.angel.architecture.services.interfaces.GenericService;

/**
 *
 * @author William
 */
public interface LoginService extends GenericService {

    /** Login user to application. If user name or password are invalid, it throws BusinessException.
     *
     * @param userName to login.
     * @param password to validate user name.
     * @return if user name and password are valid, it returns user logged. Otherwise it throws BusinessException.
     * @see com.angel.arquitectura.exception.BusinessException
     */
    public User login(String userName, String password);

    /**
     * Login an user to application.
     * 
     * @param loginInfoDTO login information to do login.
     * @return a user if user name and password are valid. Otherwise it throws {@link BusinessException}.
     * @see BusinessException.
     */
	public User login(LoginInfoDTO loginInfoDTO);

	/**
	 * Logout an user from application. If user is not logged in application, it throws {@link BusinessException}.
	 * 
	 * @param loginInfoDTO login user information to do logout.
	 */
	public void logout(LoginInfoDTO loginInfoDTO);

}